@echo off
perl util\mkfiles.pl >MINFO

del /q ms\uptable.*

IF "%2"=="" GOTO DoBuild32
IF /i "%2"=="32" GOTO DoBuild32
IF /i "%2"=="64" GOTO DoBuild64
IF /i "%2"=="ARM" GOTO DoBuildARM
IF /i "%2"=="PHONE" GOTO DoBuildPHONE
:DoBuild32
rem perl ms\uplink-x86.pl win32 > ms\uptable.asm
rem ml -c -Foms\uptable.obj ms\uptable.asm
perl util\mk1mf.pl no-asm VC-WINRT32 >ms\nt.mak
perl util\mk1mf.pl dll no-asm VC-WINRT32 >ms\ntdll.mak
GOTO DoComplete
:DoBuild64
rem perl ms\uplink-x86_64.pl masm > ms\uptable.asm
rem ml64 -c -Foms\uptable.obj ms\uptable.asm
perl util\mk1mf.pl no-asm VC-WINRT64 >ms\nt.mak
perl util\mk1mf.pl dll no-asm VC-WINRT64 >ms\ntdll.mak
GOTO DoComplete
:DoBuildARM
rem perl ms\uplink-x86_64.pl masm > ms\uptable.asm
rem ml64 -c -Foms\uptable.obj ms\uptable.asm
perl util\mk1mf.pl no-asm VC-WINRTARM >ms\nt.mak
perl util\mk1mf.pl dll no-asm VC-WINRTARM >ms\ntdll.mak
GOTO DoComplete
:DoBuildPHONE
rem perl ms\uplink-x86_64.pl masm > ms\uptable.asm
rem ml64 -c -Foms\uptable.obj ms\uptable.asm
perl util\mk1mf.pl no-asm VC-WINRTPHONE >ms\nt.mak
perl util\mk1mf.pl dll no-asm VC-WINRTPHONE >ms\ntdll.mak
:DoComplete

IF NOT EXIST ms\libeayrt.def perl util\mkdef.pl RT libeay > ms\libeayrt.def
IF NOT EXIST ms\ssleayrt.def perl util\mkdef.pl RT ssleay > ms\ssleayrt.def
